package com.dy.nygl.mapper;

import java.util.Date;
import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import com.dy.nygl.pojo.Machine;

@Component("machineDao")
public interface MachineMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Machine record);

    int insertSelective(Machine record);

    Machine selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Machine record);

    int updateByPrimaryKey(Machine record);
    
    List<Double> selectRandomTime(@Param("startTime")String startTime,@Param("endTime")String endTime,@Param("type")String type);
    
    //根据任务名，不同能源的总消耗,返回资源总值
    List<Double> selectTimeByBlurry(@Param("time")String time, @Param("monitorMedia")String monitorMedia);
    
	//根据任务名，不同能源的总消耗,返回资源最大值
    List<Double> selectTaskName(@Param("taskName")String taskName,@Param("monitorMedia")String monitorMedia);
    
    //根据机器名称，返回机器每天不同时段的消耗情况
    List<Double> selectName(@Param("name")String name,@Param("time1")Date time1,@Param("time2")Date time2);
    
    //采集类型分类
    List<Double> selectMonitorMedia(@Param("media")String monitorMedia,@Param("time1")Date time1,@Param("time2")Date time2);
    
    //添加采集数据
    void addMachineData(@Param("machine")Machine machine);
    
    List<Double> selectAllDataByEnergy(@Param("time1")Date time1,@Param("time2")Date time2,@Param("type")String type);
}